﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.WebPages.Html;
using System.Web.Mvc;
using System.Web.Routing;

namespace MVCvoucherAsp.Models
{
    public static class HTMLhelperextension
    {
        public static string Image(this System.Web.WebPages.Html.HtmlHelper helper,string url,string altText, object htmlAttributes)
        {
            TagBuilder builder = new TagBuilder("img");
            builder.Attributes.Add("src", url);
            builder.Attributes.Add("alt", altText);
            builder.MergeAttributes(new RouteValueDictionary(htmlAttributes)); 
            return builder.ToString(TagRenderMode.SelfClosing);
        }
    } 
    
}